//pack11jsclass

var ZoomPhotoPopup = new zoomPhotoPopup();

function zoomPhotoPopup() {

    this.initialized=false;
    this.element=document.getElementById("PopupBody");
    this.navigation=document.getElementById("PopupBody");

    this.PhotoZoomer = function(image) {
        if(PopupManager.container.style.display!="block") PopupManager.open('ZoomPhotoPopup');
        this.newPhoto(image.replace("large", "original"));
        ObjectCardNavigation.setZoomNavigation();
    }

    this.newPhoto=function(image) {
	wi=document.getElementById("ZoomContainer").offsetWidth;
        he=document.getElementById("ZoomContainer").offsetHeight-40;
        document.getElementById("ZoomContainer").style.backgroundImage="url(?response=PhotoZoomer&photo="+image+"&w="+wi+"&h="+he+")";
        //document.getElementById("ZoomResult").src="?response=PhotoZoomer&photo="+image+"&w="+wi+"&h="+he;
        //alert("?response=PhotoZoomer&photo="+image+"&w="+wi+"&h="+he);
    }

    this.state = function() {
        if(!this.initialized) this.init();
        return (PopupManager.container.style.display=="none" || !PopupManager.container.style.display)? false:true;
    }
    
    this.open = function() {
        if(!this.initialized) this.init();
        if(!this.initialized) return;
        this.changedElements=new Array();
        this.element.style.display="block";
        try {
            winwidth=document.all?document.body.clientWidth:window.innerWidth;
            winheight=document.all?document.body.clientHeight:window.innerHeight;
            document.getElementById("PopupBody").style.paddingLeft="8px";
            document.getElementById("popupContainer").style.width=(winwidth*0.96)+"px";
            document.getElementById("popupContainer").style.height=(winheight*0.96)+"px";
        } catch(e) {

        }
        PopupManager.container.style.display="block";
        PopupManager.currentPopup=this;
        PopupManager.popupActive=true;
    }

    this.init = function() {

        try {
            this.element=document.getElementById("ZoomPhotoPopup");
            this.navigation=document.getElementById("ZoomPhotoPopupNavigation");
        } catch(e) {
            Trace("Could not find ZoomPhotoPopup");
            return;
        }

        this.initialized=true;
    }
	
}